(function () {
    
    class Animal {
        name: string
        age: number
        constructor(name: string, age: number) {
            this.name = name
            this.age = age
        }
        bark() {
            console.log('哼哼哼！')            
        }
    }

    class Dog extends Animal {
        bark() {
            console.log('汪汪汪！')            
        }
    }

    class Cart extends Animal {
        bark() {
            console.log('喵喵喵！')            
        }
    }

    const dog = new Dog('xibao', 1)
    console.log(dog)
    console.log(dog.bark())

    const cart = new Cart('xixi', 2)
    console.log(cart)
    console.log(cart.bark())
})()